-
Notifications
You must be signed in to change notification settings - Fork 3.3k
fix(function): isolated-vm worker pool to prevent single-worker bottleneck + execution user id resolution #3155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
@cursor review |
Greptile OverviewGreptile Summary
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant API as /api/function/execute
participant IVM as isolated-vm pool
participant Redis as Redis (optional)
participant W as Worker Process
Client->>API: POST execute(code, auth)
API->>IVM: run({ownerKey, ownerWeight, code})
opt Redis configured
IVM->>Redis: eval acquireLease(ownerKey, ttl)
Redis-->>IVM: granted/denied
alt denied
IVM-->>API: 429/limit error
API-->>Client: error
end
end
IVM->>IVM: enqueue or pick least-loaded worker
IVM->>W: send execution request
W-->>IVM: result/error
opt Redis configured
IVM->>Redis: eval releaseLease(ownerKey)
end
IVM-->>API: output
API-->>Client: output
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, 2 comments
|
@cursor review |
|
@cursor review |
1 similar comment
|
@cursor review |
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
11 files reviewed, 1 comment
Additional Comments (1)
|
|
@cursor review |
|
@cursor review |
|
@cursor review |
|
@greptile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6 files reviewed, no comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Summary
Type of Change
Testing
Tested manually. Added test.
Checklist